const OAuth = require('co-wechat-oauth');

module.exports = function(config, app) {
    
    return function(ctx, next) {
        if (ctx.get('X-App-Id') === config.appId && ctx.get('X-Token') === config.appSecret) {
            return next();
        }
        ctx.throw(401);
    };
}
